<template>
  <div
    class="shoppingListItem"
    @click="changeIsBuy"
    :class="{ buyList: isBuy, first: index == 0 }"
  >
    <div class="title">{{ m.title }}</div>
    <div class="note">{{ m.note }}</div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const props = defineProps(["m", "index"]);

const isBuy = ref(false);

const changeIsBuy = () => {
  // console.log("changeIsBuy");
  isBuy.value = !isBuy.value;
};
</script>

<style lang="scss" scoped>
.shoppingListItem {
  font-size: 16px;
  height: 40px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-top: 1px dashed #999;

  .title {
    width: 200px;
  }
}
.buyList {
  color: #999;
  text-decoration: line-through;
}

.first {
  border-top: none;
}
</style>
